package com.micro.turtle.model;

import cn.hutool.core.annotation.Alias;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Git Project
 *
 * @author jason.lv
 * @since 2022/1/21 14:16
 */
@NoArgsConstructor
@Data
public class Project {

    @Alias("id")
    private Integer id;
    @Alias("description")
    private String description;
    @Alias("name")
    private String name;
    @Alias("name_with_namespace")
    private String nameWithNamespace;
    @Alias("path")
    private String path;
    @Alias("path_with_namespace")
    private String pathWithNamespace;
    @Alias("created_at")
    private String createdAt;
    @Alias("default_branch")
    private String defaultBranch;
    @Alias("tag_list")
    private List<?> tagList;
    @Alias("ssh_url_to_repo")
    private String sshUrlToRepo;
    @Alias("http_url_to_repo")
    private String httpUrlToRepo;
    @Alias("web_url")
    private String webUrl;
    @Alias("readme_url")
    private String readmeUrl;
    @Alias("avatar_url")
    private Object avatarUrl;
    @Alias("forks_count")
    private Integer forksCount;
    @Alias("star_count")
    private Integer starCount;
    @Alias("last_activity_at")
    private String lastActivityAt;
    @Alias("namespace")
    private NamespaceDTO namespace;
    @Alias("_links")
    private LinksDTO links;
    @Alias("packages_enabled")
    private Object packagesEnabled;
    @Alias("empty_repo")
    private Boolean emptyRepo;
    @Alias("archived")
    private Boolean archived;
    @Alias("visibility")
    private String visibility;
    @Alias("resolve_outdated_diff_discussions")
    private Boolean resolveOutdatedDiffDiscussions;
    @Alias("container_registry_enabled")
    private Boolean containerRegistryEnabled;
    @Alias("container_expiration_policy")
    private ContainerExpirationPolicyDTO containerExpirationPolicy;
    @Alias("issues_enabled")
    private Boolean issuesEnabled;
    @Alias("merge_requests_enabled")
    private Boolean mergeRequestsEnabled;
    @Alias("wiki_enabled")
    private Boolean wikiEnabled;
    @Alias("jobs_enabled")
    private Boolean jobsEnabled;
    @Alias("snippets_enabled")
    private Boolean snippetsEnabled;
    @Alias("service_desk_enabled")
    private Boolean serviceDeskEnabled;
    @Alias("service_desk_address")
    private Object serviceDeskAddress;
    @Alias("can_create_merge_request_in")
    private Boolean canCreateMergeRequestIn;
    @Alias("issues_access_level")
    private String issuesAccessLevel;
    @Alias("repository_access_level")
    private String repositoryAccessLevel;
    @Alias("merge_requests_access_level")
    private String mergeRequestsAccessLevel;
    @Alias("forking_access_level")
    private String forkingAccessLevel;
    @Alias("wiki_access_level")
    private String wikiAccessLevel;
    @Alias("builds_access_level")
    private String buildsAccessLevel;
    @Alias("snippets_access_level")
    private String snippetsAccessLevel;
    @Alias("pages_access_level")
    private String pagesAccessLevel;
    @Alias("operations_access_level")
    private String operationsAccessLevel;
    @Alias("analytics_access_level")
    private String analyticsAccessLevel;
    @Alias("emails_disabled")
    private Object emailsDisabled;
    @Alias("shared_runners_enabled")
    private Boolean sharedRunnersEnabled;
    @Alias("lfs_enabled")
    private Boolean lfsEnabled;
    @Alias("creator_id")
    private Integer creatorId;
    @Alias("import_status")
    private String importStatus;
    @Alias("open_issues_count")
    private Integer openIssuesCount;
    @Alias("ci_default_git_depth")
    private Integer ciDefaultGitDepth;
    @Alias("ci_forward_deployment_enabled")
    private Boolean ciForwardDeploymentEnabled;
    @Alias("public_jobs")
    private Boolean publicJobs;
    @Alias("build_timeout")
    private Integer buildTimeout;
    @Alias("auto_cancel_pending_pipelines")
    private String autoCancelPendingPipelines;
    @Alias("build_coverage_regex")
    private Object buildCoverageRegex;
    @Alias("ci_config_path")
    private String ciConfigPath;
    @Alias("shared_with_groups")
    private List<?> sharedWithGroups;
    @Alias("only_allow_merge_if_pipeline_succeeds")
    private Boolean onlyAllowMergeIfPipelineSucceeds;
    @Alias("allow_merge_on_skipped_pipeline")
    private Object allowMergeOnSkippedPipeline;
    @Alias("restrict_user_defined_variables")
    private Boolean restrictUserDefinedVariables;
    @Alias("request_access_enabled")
    private Boolean requestAccessEnabled;
    @Alias("only_allow_merge_if_all_discussions_are_resolved")
    private Boolean onlyAllowMergeIfAllDiscussionsAreResolved;
    @Alias("remove_source_branch_after_merge")
    private Boolean removeSourceBranchAfterMerge;
    @Alias("printing_merge_request_link_enabled")
    private Boolean printingMergeRequestLinkEnabled;
    @Alias("merge_method")
    private String mergeMethod;
    @Alias("suggestion_commit_message")
    private Object suggestionCommitMessage;
    @Alias("auto_devops_enabled")
    private Boolean autoDevopsEnabled;
    @Alias("auto_devops_deploy_strategy")
    private String autoDevopsDeployStrategy;
    @Alias("autoclose_referenced_issues")
    private Boolean autocloseReferencedIssues;

    @NoArgsConstructor
    @Data
    public static class NamespaceDTO {

        @Alias("id")
        private Integer id;
        @Alias("name")
        private String name;
        @Alias("path")
        private String path;
        @Alias("kind")
        private String kind;
        @Alias("full_path")
        private String fullPath;
        @Alias("parent_id")
        private Integer parentId;
        @Alias("avatar_url")
        private Object avatarUrl;
        @Alias("web_url")
        private String webUrl;
    }

    @NoArgsConstructor
    @Data
    public static class LinksDTO {

        @Alias("self")
        private String self;
        @Alias("issues")
        private String issues;
        @Alias("merge_requests")
        private String mergeRequests;
        @Alias("repo_branches")
        private String repoBranches;
        @Alias("labels")
        private String labels;
        @Alias("events")
        private String events;
        @Alias("members")
        private String members;
    }

    @NoArgsConstructor
    @Data
    public static class ContainerExpirationPolicyDTO {

        @Alias("cadence")
        private String cadence;
        @Alias("enabled")
        private Boolean enabled;
        @Alias("keep_n")
        private Object keepN;
        @Alias("older_than")
        private Object olderThan;
        @Alias("name_regex")
        private Object nameRegex;
        @Alias("name_regex_keep")
        private Object nameRegexKeep;
        @Alias("next_run_at")
        private String nextRunAt;
    }
}
